package com.wxzz.elearing.user.api.app;

import com.wxzz.elearing.user.dto.HelpCenterDto;
import com.wxzz.elearing.user.dto.PlatformParamSelDto;
import com.wxzz.elearing.user.entity.HelpCenter;
import com.wxzz.elearing.user.entity.PlatformParam;
import com.wxzz.elearing.user.service.IPlatformParamService;
import com.wxzz.elearning.common.vo.JgPageVo;
import com.wxzz.elearning.common.vo.ReturnVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/wx-platform-param")
@Api(tags = "平台参数(小程序)")
public class WxPlatformParamController {

    @Autowired
    private IPlatformParamService platformParamService;

    @ApiOperation(value = "查询平台参数", notes = "查询平台参数", httpMethod = "POST", tags = "小程序")
    @RequestMapping(value = "selectOnePlatformParam", method = RequestMethod.POST)
    public ReturnVO<PlatformParam> selectOnePlatformParam(@RequestHeader String token, @RequestBody PlatformParamSelDto platformParamSelDto) {
        return platformParamService.selectOnePlatformParam(platformParamSelDto);
    }

    @ApiOperation(value = "列出帮助中心", notes = "列出帮助中心", httpMethod = "POST", tags = "小程序")
    @RequestMapping(value = "listHelpCenter", method = RequestMethod.POST)
    public ReturnVO<JgPageVo<List<HelpCenter>>> listHelpCenter(@RequestBody HelpCenterDto helpCenterDto) {
        return platformParamService.listHelpCenter(helpCenterDto);
    }

    @ApiOperation(value = "查询帮助中心详情", notes = "查询帮助中心详情", httpMethod = "POST", tags = "小程序")
    @RequestMapping(value = "selectHelpCenterDetail/{helpCenterId}", method = RequestMethod.POST)
    public ReturnVO<HelpCenter> selectHelpCenterDetail(@PathVariable Long helpCenterId) {
        return platformParamService.selectHelpCenterDetail(helpCenterId);
    }

    @ApiOperation(value = "查询所有查询所有客服电话", notes = "查询所有查询所有客服电话", httpMethod = "POST", tags = "后台")
    @RequestMapping(value = "selectPlatformParamPhoneVo", method = RequestMethod.POST)
    public ReturnVO selectPlatformParamPhoneVo() {
        return platformParamService.selectPlatformParamPhoneVo();
    }

    @ApiOperation(value = "查询所有小程序审核功能设置", notes = "查询所有小程序审核功能设置", httpMethod = "POST", tags = "后台")
    @RequestMapping(value = "selectPlatformParamVo", method = RequestMethod.POST)
    public ReturnVO selectPlatformParamVo() {
        return platformParamService.selectPlatformParamVo();
    }


}
